function pasteEvent(e) {
	e.preventDefault();
	let text = (e.originalEvent || e).clipboardData.getData('text/plain').replace(/\r\n/g, '');
	// 将内容插入到光标位置
	const selection = window.getSelection();
	const range = selection.getRangeAt(0);
	range.deleteContents(); // 删除当前选中的内容（如果有的话）
	const textNode = document.createTextNode(text);
	range.insertNode(textNode);
	// 设置光标到粘贴内容的最后
	range.setStart(textNode, text.length);
	range.setEnd(textNode, text.length);
	selection.removeAllRanges();
	selection.addRange(range);
}
export default {
	inserted(el, bindding, vnode) {
		el.addEventListener('paste', pasteEvent);
	},

	unbind(el, bindding, vnode, oldVnode) {
		el.removeEventListener('paste', pasteEvent);
	}
};
